package com.test.kotlin02

/***
 * 返回函数引用
 */
fun main(){
    showOnBoard2("牙膏",::getDiscountWords)
}


 fun  getDiscountWords( goodsName:String,hour:Int):String{//返回函数引用
    val currentYear = 2021
    return "${currentYear}年双十一${goodsName}促销倒计时:$hour 小时"  //返回函数引用
}

private fun showOnBoard2(goodsName:String,getDiscountWords2222:(String,Int) ->String){
    val hour:Int = (1..24).shuffled().last();
    println(getDiscountWords2222(goodsName,hour))
}



